package com.mytest;

import com.mytest.service.HelloService;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.Future;

public class XMLConsumerMain {
    public static void main(String[] args) throws  Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("consumer.xml");
        // 获取消费者组件
        HelloService  service = context.getBean(HelloService.class);
        while(true){
            System.in.read();
            //String result = service.sayWorld("world", 100);
            service.sayHelloA("world");
            Future<Object> future = RpcContext.getContext().getFuture();
           // System.out.println("result:"+result);
            System.out.println("future result:"+future.get());

        }
    }

}
